<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>阿酷TONY--Tangni</title>
</head>

<body>
    <div style="text-align:center">
        <button οnclick="playPause()">播放/暂停</button>
        <button οnclick="makeBig()">放大</button>
        <button οnclick="makeSmall()">缩小</button>
        <button οnclick="makeNormal()">普通</button>
        <button οnclick="getPlaySpeed()" type="button">当前播放速度</button>
        <button οnclick="setPlaySpeed()" type="button">将视频设定为2倍播放速度</button>
        <br>
        <video id="video" width="600" autoplay controls> 
            <source src="test.mp4" type="video/mp4">
            TONY提示：您浏览器不支持 HTML5 video 标签。 
        </video>
    </div>
    <script>
        var myVideo = document.getElementById("video");

        function getPlaySpeed() {
            alert("当前视频播放速度为：" + myVideo.playbackRate); //获取播放速度
        }

        function setPlaySpeed() {
            alert("视频将以2倍速度播放"); //获取播放速度
            myVideo.playbackRate = 2; //设定新的播放速度2倍速度
        }

        function playPause() {
            if (myVideo.paused)
                myVideo.play(); //播放
            else
                myVideo.pause(); //暂停播放
        }

        function makeBig() {
            myVideo.width = 660;
        }

        function makeSmall() {
            myVideo.width = 230;
        }

        function makeNormal() {
            myVideo.width = 400;
        }
    </script>
</body>
</html>